<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    
	
	<title>_预包装计划</title>
	<script type="text/javascript">
	
        $(function() {
		    $("#queryForm").validate(); 
			$("#_fromDate").datepicker({ format : 'yyyy-mm-dd' });
			$("#_toDate").datepicker({ format : 'yyyy-mm-dd' });
       });
	  
        
       //删除入库单
       function deleteBill(billId){
          return;
          $.ajax({
			   type : 'post',
				url : '${ctx}/instorageBill/ajaxDelete',
				data : {
					billId:billId
				},
				dataType : 'json',
				success : function(data) {
				   if(data==true){
				      $("#queryForm").submit();
				   }else{
				      alert("网络繁忙，请稍后重试...");
				   }	
				},
				error : function() {
					alert("网络繁忙，请稍后重试...");
				}
			}); 
          
       }
 		
		
    </script>
</head>

<body>
	<div style="height: 10px;"></div>
	<form class="form-search" id="queryForm" action="${ctx}/prepkgPlan/queryPlan" method="post">
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
	    <thead>
			<th style="vertical-align: middle; color: white; " colspan="13" bgcolor="#8EB4CB">条件查询</th>
		</thead>
		
		<tr><td>
			    <label style="margin-left: 10px;">商家名称：</label>
				 <select  name="_customerCode"  id="_customerCode" value="${param._customerCode}"  class="input-medium required" onchange="ajaxAreaGroup(this,'_warehouseCode');">
					<option value=""></option>
					<c:forEach items="${customerList}" var="customer">
						<option value="${customer.customerCode}"
						<c:if test="${param._customerCode eq customer.customerCode}">selected=selected</c:if>
						>${customer.customerName}</option>
					</c:forEach>
				</select>
				
				<label style="margin-left: 10px;">作业仓库：</label>
				   <select  name="_warehouseCode"  id="_warehouseCode"  class="input-medium" >
				     <option value=""></option>  
				     <c:forEach items="${warehouseList}" var="warehouse">
				       <option value="${warehouse.groupCode}" 
				       <c:if test="${param._warehouseOutCode eq warehouse.groupCode }">selected=selected</c:if>
				       >${warehouse.groupName}</option>
				     </c:forEach>
				</select>
			
				<label style="margin-left:10px;">计划编号：</label> 
				<input type="text" id="_planCode" name="_planCode" class="input-medium" value="${param._planCode}"/>
				
		   </td></tr>
		   
		   
	       <tr><td>
	   		<label style="margin-left:10px;">计划状态：</label> 
				<select  name="_status"  id="_status"   class="input-medium">
					<option value="" <c:if test="${param._status eq ''}">selected=selected</c:if> ></option>
				    <option value="create" <c:if test="${param._status eq 'create'}">selected=selected</c:if> >创建计划</option>
				    <option value="tokePickTask" <c:if test="${param._status eq 'tokePickTask'}">selected=selected</c:if> >领取拣货任务</option>
				    <option value="cmpPickTask" <c:if test="${param._status eq 'cmpPickTask'}">selected=selected</c:if> >完成拣货任务</option>
				    <option value="tokePkgTask" <c:if test="${param._status eq 'tokePkgTask'}">selected=selected</c:if> >领取包装任务</option>
				    <option value="cmpPkgTask" <c:if test="${param._status eq 'cmpPkgTask'}">selected=selected</c:if> >完成包装任务</option>
				    <option value="tokeUpTask" <c:if test="${param._status eq 'tokeUpTask'}">selected=selected</c:if> >领取上架任务</option>
				    <option value="finish" <c:if test="${param._status eq 'finish'}">selected=selected</c:if> >完成上架任务</option>
				</select>
				
				<label>&nbsp;&nbsp;&nbsp;创建日期：</label> 
			 	<input type="text" name="_fromDate" id="_fromDate"  class="input-small" value="${param._fromDate}"> 
			 	<label>至</label> 
			 	<input type="text" name="_toDate" id="_toDate" class="input-small" value="${param._toDate}"> 
			 	
			    <button type="submit" class="btn btn-primary" style="margin-left: 10px;">搜索</button>
			    <a href="${ctx}/prepkgPlan/toCreatePlan"   class="btn btn-info" >创建计划</a>
		    
	       </td></tr>
	   
	   </table>
	   </form>
	
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead><tr>
		    <th style="width: 100px;">商家</th>
		    <th style="width: 80px;">仓库</th>
		    <th style="width: 80px;">计划编号</th>
			<th style="width: 80px;">SKU数量</th>
			<th style="width: 80px;">商品数量</th>
			<th style="width: 150px;">创建时间</th>
			<th style="width: 100px;">创建人</th>
			<th style="width: 80px;">状态</th>
			<!-- <th style="width: 150px;">管理</th> -->
		</tr></thead>
		<tbody>
		
		<c:if test="${page eq null}">
	       <tr><td colspan="19" height="50" style="vertical-align:middle; text-align: center;color: gray;font-size: 20px;">无数据</td></tr>
	    </c:if>
	    
		<c:if test="${page ne null}">
				<c:forEach items="${page.content}" var="plan">
					<tr>
						<td>${plan.customerCode}</td>
						<td>${plan.warehouseCode}</td>
						<td>${plan.planCode}</td>
						<td>${plan.skuNum}</td>
						<td>${plan.goodsNum}</td>
						<td>${fn:substring(plan.createTime,0,19)}</td>
						<td>${plan.createrUuid}</td>
						<td>
						    <c:if test="${plan.status eq 'create' }">创建计划</c:if> 
						    <c:if test="${plan.status eq 'tokePickTask' }">领取拣货任务</c:if> 
							<c:if test="${plan.status eq 'cmpPickTask' }">完成拣货任务</c:if>
							<c:if test="${plan.status eq 'tokePkgTask' }">领取包装任务</c:if>
							<c:if test="${plan.status eq 'cmpPkeTask' }">完成包装任务</c:if>
							<c:if test="${plan.status eq 'tokeUpTask' }">领取上架任务</c:if>
							<c:if test="${plan.status eq 'finish' }">完成上架任务</c:if>
						</td>
						<!--<td>
							<a href="#detail" data-toggle="modal" class="btn btn-primary" onclick="">详情</a>
							<c:if test="${plan.status eq 'create' }">
								<a class="btn btn-danger" href="${ctx}/prepkgPlan/delete/${plan.id }" >删除</a>
							</c:if>
							
						</td>
						-->
					</tr>
				</c:forEach>
			</c:if>
		</tbody>
	</table>
	
	<c:if test="${page ne null}">
		  <tags:pagination page="${page}" paginationSize="5"/>
	</c:if>
	
</body>
</html>
